import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import { join } from 'path'

import pxtovw from 'postcss-px-to-viewport'



//配置参数
const usePxtovw = pxtovw({
  viewportWidth: 375,
  viewportUnit: 'vw',
  propList: ["*"], // 能转化为vw的属性列表
})


// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  css: {
    postcss: {
      plugins: [usePxtovw]
    }
  },
  resolve: {
    alias: {
      '@': join(__dirname, "src"),
    }
  }
})